import { reqgetOrderList } from '@/api'

let state = {
  orderListObj: {}
}

let mutations = {
  GETORDERLISTOBJ(state, data) {
    state.orderListObj = data
  }
}

let actions = {
  async getOrderListObj({ commit }, { page, limit }) {
    const res = await reqgetOrderList(page, limit)

    if (res.code == 200) {
      commit('GETORDERLISTOBJ', res.data)
      return { ok: true }
    } else {
      return { ok: false, msg: res.message }
    }
  }
}

let getters = {}

export default {
  state,
  mutations,
  actions,
  getters
}
